<include file="Public/header" />

<div class="am-cf admin-main">
  <include file="Public/sidebar" />

  <!-- content start -->
  <div class="admin-content">

    <div class="am-cf am-padding">
      <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">首页</strong> / <small>添加权限</small></div>
    </div>

    <div class="am-g">
      <div class="am-u-sm-12">
      
		<form class="am-form" method="post" action="{:U('Auth/setRuleHandle')}">
		  <fieldset>
		    <legend>权限分配</legend>
		
			<input type="hidden" name="id" value="{$id}" />
			<foreach name="rule" item="r">
				<label class="am-checkbox-inline">
					<input type="checkbox" name="rule[]" id="rule[]" value="{$r[id]}" <if condition="in_array($r[id], $rules)">checked="checked"</if>> {$r.title}
				</label>
		    </foreach>
		
		    <p><button type="submit" class="am-btn am-btn-default">更新</button></p>
		  </fieldset>
		</form>
        
      </div>
    </div>

  </div>
  <!-- content end -->

</div>

<a class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>

<footer>
  <hr>
  <p class="am-padding-left">© 2015 AllMobilize, Inc. Licensed under MIT license.</p>
</footer>

<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/polyfill/rem.min.js"></script>
<script src="assets/js/polyfill/respond.min.js"></script>
<script src="assets/js/amazeui.legacy.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="__PUBLIC__/assets/js/jquery.min.js"></script>
<script src="__PUBLIC__/assets/js/amazeui.min.js"></script>
<!--<![endif]-->
<script src="__PUBLIC__/assets/js/app.js"></script>
</body>
</html>